const server = require("../../myconfig.js").config.serverApi;

function requestCourseList(){
  return new Promise((resolve,reject)=>{
    wx.request({
      url:server+"select/all/course",
      method:"POST",
      success:function(res){
        console.log("发送请求课程列表的请求成功,得到数据如下",res.data)
        resolve( res.data.courses)
      },
      fail:(err)=>{
        console.log("请求课程列表失败",err)
        reject(err)
      }
    })
  })
}
module.exports={
  requestCourseList:requestCourseList
}